package com.biz.primus.ms.auth.service;

import com.biz.primus.base.enums.CommonStatus;
import java.util.List;

import com.biz.primus.ms.auth.dao.po.MenuGroup;
import com.biz.primus.ms.auth.dao.repository.MenuGroupRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by defei on 9/5/17.
 */
@Service
public class MenuGroupService {

    @Autowired
    public MenuGroupService(MenuGroupRepository menuGroupRepository) {
        this.menuGroupRepository = menuGroupRepository;
    }

    public List<MenuGroup> findEnabledMenuGroups() {

        return menuGroupRepository.findByStatusOrderByOrderIndexAscNameAsc(CommonStatus.ENABLE);
    }

    private final MenuGroupRepository menuGroupRepository;
}
